#ifndef QFUNCODEWIDGET_H
#define QFUNCODEWIDGET_H

#include "../../libs/core/qabstractpagewidget.h"

#include <QTextEdit>
#include <QPrintPreviewDialog>

class QFunCodeTreeWidget;
class QParamTreeWidget;
class QMachineValue;

class QFuncodeWidget: public QAbstractPageWidget
{
    Q_OBJECT
public:
    QFuncodeWidget(QWidget* parent=0);
protected:
    void    set_action_enabled(bool enabled);
protected slots:
    void funcode_changed();
    void new_machine();
    void release_machine();

    void    save(bool log=true);
    void    open();
    void    up_load();
    void    down_load();
    void    down_load_finish(bool success);
    void    compare();
    void    print();
    void    painter(QPrinter *p);
    void    save_as_pdf();

protected:
    QFunCodeTreeWidget*     m_group_list_view;
    QParamTreeWidget*       m_param_list_view;
    QList<QAction*>         m_action_list;
    QList<QMachineValue*>   m_print_list;
    QPrintPreviewDialog*    m_print_preview_dialog;
    QTextEdit*              m_print_textedit;
};

#endif // QFUNCODEWIDGET_H
